Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Pylint Errors in Dev #2669

Merged
merged 8 commits into from
Jan 24, 2024
Merged

Fix Pylint Errors in Dev #2669

merged 8 commits into from
Jan 24, 2024

Conversation

IsaacMilarky
Copy link
Contributor

@IsaacMilarky IsaacMilarky commented Jan 23, 2024

Description

  • Added module doc-strings to data_parse.py
  • Removed unneeded parameters from various methods
  • Removed unused variables
  • Fixed some minor import issues
  • Document GitLab task structures
  • Add linting compliance to various files

Signed commits

  • Yes, I signed my commits.

@IsaacMilarky IsaacMilarky changed the base branch from main to dev January 23, 2024 16:18
augur/api/view/routes.py Show resolved Hide resolved
@@ -1,4 +1,5 @@
import logging
import math
from flask import Flask, render_template, render_template_string, request, abort, jsonify, redirect, url_for, session, flash
from sqlalchemy.orm.exc import NoResultFound
from .utils import *

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
E0402: Attempted relative import beyond top-level package (relative-beyond-top-level)

@@ -1,4 +1,5 @@
import logging
import math
from flask import Flask, render_template, render_template_string, request, abort, jsonify, redirect, url_for, session, flash
from sqlalchemy.orm.exc import NoResultFound
from .utils import *

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0401: Wildcard import utils (wildcard-import)

augur/api/view/utils.py Show resolved Hide resolved
@@ -1,6 +1,7 @@
from pathlib import Path
from concurrent.futures import ThreadPoolExecutor
from flask import render_template, flash, url_for, Flask
from .init import init_logging

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
E0402: Attempted relative import beyond top-level package (relative-beyond-top-level)

@@ -1,6 +1,7 @@
from pathlib import Path
from concurrent.futures import ThreadPoolExecutor
from flask import render_template, flash, url_for, Flask
from .init import init_logging
from .init import *

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
E0402: Attempted relative import beyond top-level package (relative-beyond-top-level)

@@ -1,6 +1,7 @@
from pathlib import Path
from concurrent.futures import ThreadPoolExecutor
from flask import render_template, flash, url_for, Flask
from .init import init_logging
from .init import *

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0401: Wildcard import init (wildcard-import)

@@ -1,6 +1,7 @@
from pathlib import Path
from concurrent.futures import ThreadPoolExecutor
from flask import render_template, flash, url_for, Flask
from .init import init_logging
from .init import *
from ..server import app, db_session

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
E0402: Attempted relative import beyond top-level package (relative-beyond-top-level)

@@ -76,7 +76,16 @@ def retrieve_all_pr_data(repo_git: str, logger, key_auth) -> None:


def process_pull_requests(pull_requests, task_name, repo_id, logger, augur_db):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
R0914: Too many local variables (32/30) (too-many-locals)

Returns:
Sum of issues and prs for that repo
"""

from augur.tasks.github.util.gh_graphql_entities import GitHubRepo as GitHubRepoGraphql

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0415: Import outside toplevel (augur.tasks.github.util.gh_graphql_entities.GitHubRepo) (import-outside-toplevel)

Signed-off-by: Isaac Milarsky <[email protected]>
@@ -37,9 +41,9 @@ def root(path=""):
def logo(brand=None):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

@@ -6,8 +6,8 @@


class GitlabRandomKeyAuth(RandomKeyAuth):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
R0903: Too few public methods (1/2) (too-few-public-methods)

key_auth: GitLab specific key auth retrieval collection
logger: logging object
platform_id: GitLab specific platform id (github is 1)
"""

def __init__(self, logger):

from augur.tasks.init.celery_app import engine

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0415: Import outside toplevel (augur.tasks.init.celery_app.engine) (import-outside-toplevel)

@@ -73,7 +89,17 @@ def retrieve_all_gitlab_issue_data(repo_git, logger, key_auth) -> None:
return all_data

def process_issues(issues, task_name, repo_id, logger, augur_db) -> None:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)

@@ -186,7 +228,7 @@ def retrieve_all_gitlab_issue_comments(key_auth, logger, issue_ids, repo_git):

for id in issue_ids:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0622: Redefining built-in 'id' (redefined-builtin)

@@ -283,6 +351,16 @@ def collect_merge_request_reviewers(mr_ids, repo_git) -> int:
logger.info(f"{owner}/{repo} has no gitlab merge request reviewers")

def process_mr_reviewers(data, task_name, repo_id, logger, augur_db):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0613: Unused argument 'task_name' (unused-argument)

@@ -283,6 +351,16 @@ def collect_merge_request_reviewers(mr_ids, repo_git) -> int:
logger.info(f"{owner}/{repo} has no gitlab merge request reviewers")

def process_mr_reviewers(data, task_name, repo_id, logger, augur_db):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0613: Unused argument 'logger' (unused-argument)

Signed-off-by: Isaac Milarsky <[email protected]>
else:
logger.info(f"{owner}/{repo} has no gitlab merge request reviewers")

def process_mr_reviewers(data, task_name, repo_id, logger, augur_db):
def process_mr_reviewers(data, repo_id, logger, augur_db):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0613: Unused argument 'logger' (unused-argument)

Signed-off-by: Isaac Milarsky <[email protected]>
@IsaacMilarky IsaacMilarky marked this pull request as ready for review January 23, 2024 19:20
@sgoggins sgoggins merged commit bd80a0e into dev Jan 24, 2024
7 of 8 checks passed
@sgoggins sgoggins deleted the isaac-fix-pylint-errs branch February 20, 2024 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants